package spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * project: forum
 * ate: 14-9-9
 * author: wzq
 * description: TODO
 */
@Controller
@RequestMapping("/login")
public class LoginController {

    @RequestMapping(method = RequestMethod.POST)
    public ModelAndView doLogin(HttpServletRequest req, HttpServletResponse res) throws IOException {
        System.out.println("login controller");

        String type = req.getParameter("loginType");
        System.out.println("type = " + type);
        String loginTypeValue = req.getParameter("loginTypeValue");
        System.out.println("loginTypeValue = " + loginTypeValue);
        String pwd = req.getParameter("password");
        System.out.println("pwd = " + pwd);

        return new ModelAndView("login_succ");
    }
}
